package com.example.spring.arithmetic.heap;

import java.util.PriorityQueue;

/**
 * @author: orange
 * @create: 2023-08-07 23:45
 * @description:
 */
public class PriorityQueueMain {

    public static void main(String[] args) {
        int[] temp = {40, 2, 33, 26, 35, 8, 8, 26, 29, 2};
        PriorityQueue<Integer> priorityQueue = new PriorityQueue<>();
        for (int i = 0; i < temp.length; i++) {
            priorityQueue.offer(temp[i]);
        }
        while (!priorityQueue.isEmpty()) {
            System.out.format("%d ", priorityQueue.poll());
        }
    }
}
